package com.yz.house.ui.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.yz.house.R;
import com.yz.house.base.BaseActivity;
import com.yz.house.model.OrdersBean;
import com.yz.house.ui.adaper.OrdersAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Demo
 *
 * @author zhangyf
 * @date 2018/4/13 0013.
 */
public class MyOrdersActivity extends BaseActivity {

    @BindView(R.id.iv_back)
    ImageView iv_back;
    @BindView(R.id.rv_order)
    RecyclerView rv_orders;
    OrdersAdapter adapter;
    List<OrdersBean> data;

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_orders;
    }

    @Override
    protected void initVariables(Bundle extras, Bundle savedInstanceState) {
        data = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            data.add(new OrdersBean());
        }
    }

    @Override
    protected void initViews() {
        adapter = new OrdersAdapter(data);
        rv_orders.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        rv_orders.setAdapter(adapter);
    }

    @Override
    protected boolean shouldBindEvent() {
        return false;
    }


    @OnClick({R.id.iv_back,})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                onBackPressed();
                break;
        }
    }
}
